<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>
        单据管理
    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <div class="row">
                        <div class="form-inline">
                            <div class="form-group" style="margin-right: 10px;">
                                <label>单据类型</label>
                                <select id="inTypeQuery" name="inTypeQuery" class="form-control">
                                    <option value="" selected>全部</option>
                                    <option value="1" >制作件入库</option>
                                    <option value="2" >外购/外协入库</option>
                                    <option value="3" >调拨入库</option>
                                    <option value="4" >制作件出库</option>
                                    <option value="5" >外购/外协出库</option>
                                </select>
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>物料描述</label>
                                <input type="text" id="" name="projectNameQuery" class="form-control" placeholder="请输入物料描述">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>跟踪号</label>
                                <input type="text" id="trackCodeQuery" name="trackCodeQuery" class="form-control" placeholder="请输入跟踪号">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <label>项目信息</label>
                                <input type="text" id="projectNameQuery" name="projectNameQuery" class="form-control" placeholder="请输入项目名称">
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <button class="btn btn-vk" id="btn_search">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;搜索&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
                            </div>
                            <div class="form-group" style="margin-right: 10px;">
                                <button id="btnFilter" type="button" class="btn btn-block" data-toggle="collapse"
                                        data-target="#queryHiddenDiv">
                                    <!--<span class="glyphicon glyphicon-filter"></span>-->显示更多条件
                                </button>
                                <!--btn-social-->
                            </div>
                        </div>
                    </div>
                    <div class="row collapse" id="queryHiddenDiv" style="margin-top: 10px">
                        <div class="form-inline">
                            <div class="form-group" style="margin-right: 10px;margin-bottom: 10px">
                                <label>项目编号</label>
                                <input type="text" id="projectCodeQuery" name="projectCodeQuery" class="form-control" placeholder="请输入项目编号">
                            </div>
                            <div class="form-group" style="margin-right: 10px;margin-bottom: 10px">
                                <label>品牌</label>
                                <input type="text" id="stockMaterialTypeQuery" name="stockMaterialTypeQuery" class="form-control" placeholder="请输入品牌">
                            </div>
                            <div class="form-group" style="margin-right: 10px;margin-bottom: 10px">
                                <label>图号</label>
                                <input type="text" id="stockMaterialQualityQuery" name="stockMaterialQualityQuery" class="form-control" placeholder="请输入图号">
                            </div>
                            <div class="form-group" style="margin-right: 10px;margin-bottom: 10px">
                                <label>存放状态</label>
                                <select id="stockMaterialSpecQuery" name="stockMaterialSpecQuery" class="form-control">
                                    <option value="" selected>全部</option>
                                    <option value="待装配" >待装配</option>
                                    <option value="待发货" >待发货</option>
                                    <option value="待机加" >待机加</option>
                                    <option value="待外协" >待外协</option>
                                </select>
                            </div>
                            <div class="form-group" style="margin-right: 10px;margin-bottom: 10px">
                                <label>是否成品</label>
                                <select id="a" name="stockMaterialSpecQuery" class="form-control">
                                    <option value="" selected>全部</option>
                                    <option value="1" >是</option>
                                    <option value="0" >否</option>
                                </select>
                            </div>
                            <div class="form-group" style="margin-right: 10px;margin-bottom: 10px">
                                <label>往来部门</label>
                                <select id="dept" name="stockMaterialSpecQuery" class="form-control">
                                    <option value="" selected>全部</option>
                                    <option value="1" >是</option>
                                    <option value="0" >否</option>
                                </select>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div id="goToTop"
     th:style="|position:fixed; right:0px; bottom:10px; width:20px; height:75px; background-image: url(@{/img/gototop.gif}); cursor:pointer|"></div>
<div th:include="include :: footer"></div>
<script th:src="@{/js/jquery.PrintArea.js}"></script>

<script th:inline="javascript">
    var table;
    function showQuery() {
        $("#queryHiddenDiv").show();
        $("#up").show();
        $("#down").hide();
    }

    function hiddenQuery() {
        $("#queryHiddenDiv").hide();
        $("#up").hide();
        $("#down").show();
    }

    $(function () {

        /** 加载表格 */
        table = js.table.init({
            url: ctx + "half/halInvManage/InvInfoEdit/list",
            columns: [
                {
                    title: '序号', field: 'id', width: '40',
                    formatter: function (value, row, index, field) {
                        return index + 1;
                    }
                },
                { title: "物料描述", field: 'ityMatName', width: '80'},
                { title: "SAP物料编码", field: 'itySapCode'},
                { title: "图号", field: 'ityDrawingNumber', width: '150'},
                { title: "数量", field: 'ityNum', width: '150'},
                { title: "单位", field: 'ityUnit', width: '100'},
                { title: "单价", field: 'ityPrice', width: '150'},
                { title: "金额", field: 'ityAmount', width: '80'},
                { title: "跟踪号", field: 'ityTrackCode'},
                { title: "品牌", field: 'ityBrand', width: '150'},
                { title: "项目编号", field: 'ityProCode', width: '150'},
                { title: "项目名称", field: 'ityProName', width: '100'},
                { title: "部分名称", field: 'ityPart', width: '150'},
                { title: "是否成品", field: 'ityIfFinishedProduct', width: '80'},
                { title: "存放状态", field: 'ityMakingPiecesStatus'},
                { title: "备注", field: 'ityRemark', width: '150'},
                //{ title: "入库时间", field: 'receiver', width: '150'},
                { title: "存放位置", field: 'ityPosition', width: '100'},
                { title: "台账", field: 'address', width: '150'}
                /*{
                    title: "操作", width: '180',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs" href="'+ ctx + 'overview/program/' + row.id + '"> 查看</a> ');
                        if (row.status === 1) {
                            if (hasP("program:update")) {
                                actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="openEditProgramModal(' + row.id + ')"> 编辑</a> ');
                            }
                            if (hasP("program:commit")) {
                                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="commit(' + row.id + ')"> 提交</a> ');
                            }
                        } else {
                            if (hasP("program:reject")) {
                                actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="reject(' + row.id + ')"> 驳回</a> ');
                            }
                        }
                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="del(' + row.id + ')"> 删除</a> ');
                        return actions.join('');
                    }
                }*/
            ]
        });

        // 搜索
        $("#btn_search").click(function () {
            $.table.search({
                projectCodeQuery: $("#projectCodeQuery").val(),
                projectNameQuery: $("#projectNameQuery").val(),
                trackCodeQuery: $("#trackCodeQuery").val(),
                stockMaterialTypeQuery: $("#stockMaterialTypeQuery").val(),
                stockMaterialQualityQuery: $("#stockMaterialQualityQuery").val(),
                stockMaterialSpecQuery: $("#stockMaterialSpecQuery").val(),
                stockMaterialLengthQuery: $("#stockMaterialLengthQuery").val(),
                stockMaterialWidthQuery: $("#stockMaterialWidthQuery").val(),
                stockMaterialHeightQuery: $("#stockMaterialHeightQuery").val(),
                materialKindQuery: $("#materialKindQuery").val(),
                inTypeQuery: $("#inTypeQuery").val()
            });
        });

        $('#queryHiddenDiv').on('show.bs.collapse', function () {
            $("#btnFilter").text("");
            var txt1="<!--<span class='glyphicon glyphicon-filter'></span>-->隐藏更多条件";
            $("#btnFilter").append(txt1);
        })

        $('#queryHiddenDiv').on('hide.bs.collapse', function () {
            $("#btnFilter").text("");
            var txt1="<!--<span class='glyphicon glyphicon-filter'></span>-->显示更多条件";
            $("#btnFilter").append(txt1);
        })

    });

</script>
</body>
</html>